package config

import (
	"gitee.com/g-qs/gin-vue-admin/server/api/v1"
	"gitee.com/g-qs/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ConfigRouter struct {
}

// InitConfigRouter 初始化 Config 路由信息
func (s *ConfigRouter) InitConfigRouter(Router *gin.RouterGroup) {
	appConfigRouter := Router.Group("appConfig").Use(middleware.OperationRecord())
	appConfigRouterWithoutRecord := Router.Group("appConfig")
	var appConfigApi = v1.ApiGroupApp.ConfigApiGroup.ConfigApi
	{
		appConfigRouter.POST("createConfig", appConfigApi.CreateConfig)             // 新建Config
		appConfigRouter.DELETE("deleteConfig", appConfigApi.DeleteConfig)           // 删除Config
		appConfigRouter.DELETE("deleteConfigByIds", appConfigApi.DeleteConfigByIds) // 批量删除Config
		appConfigRouter.PUT("updateConfig", appConfigApi.UpdateConfig)              // 更新Config
	}
	{
		appConfigRouterWithoutRecord.GET("findConfig", appConfigApi.FindConfig)             // 根据ID获取Config
		appConfigRouterWithoutRecord.GET("getConfigList", appConfigApi.GetConfigList)       // 获取Config列表
		appConfigRouterWithoutRecord.GET("getAllConfigList", appConfigApi.GetAllConfigList) // 获取全部系统配置列表
	}
}
